//
//  DFClickheadInViewViewController.m
//  DFront
//
//  Created by lanou on 15/10/29.
//  Copyright © 2015年 xuzenghui. All rights reserved.
//

#import "DFClickheadInViewViewController.h"
#import "RTSpinKitView.h"
@interface DFClickheadInViewViewController ()<UIWebViewDelegate>

@property (nonatomic,strong)RTSpinKitView *refreash;

@end

@implementation DFClickheadInViewViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationController.navigationBar.hidden = YES;
    
    self.view.backgroundColor = [UIColor whiteColor];
    [self.topView addSubview:self.backBtn];
    UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0,- 40, kScreenWidth, kScreenHeight + 40)];
    webView.delegate = self;
    NSString *str1 = @"http://m.zol.com.cn/article/";
    NSString *str2 = [str1 stringByAppendingString:self.str];
    NSString *str3 = [str2 stringByAppendingString:@".html"];
    NSLog(@"%@",str3);
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str3]]];
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 20)];
    label.backgroundColor = [UIColor whiteColor];

    [self.view addSubview:webView];
    [self.view addSubview:self.topView];
    [self.view addSubview:label];
    
    //  加载动画
    CGRect screenBounds = [[UIScreen mainScreen] bounds];
    _refreash = [[RTSpinKitView alloc]initWithStyle:RTSpinKitViewStyleWanderingCubes color:[UIColor redColor]];
    _refreash.center = CGPointMake(CGRectGetMidX(screenBounds), CGRectGetMidY(screenBounds));
    [self.view addSubview:_refreash];
    
    // Do any additional setup after loading the view.
}

-(void)webViewDidFinishLoad:(UIWebView *)webView
{
    [_refreash removeFromSuperview];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
